Repository navigation
Use graphql-java's TypeUtil to unwrap and print SDL types - #871
Merged
Merged
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Checklist
Description
Our
Type<*>.unwrap()returnedType<*>, so most callers cast the result toTypeNameeven though an unwrapped SDL type is always aTypeName. It now returnsTypeNamethrough graphql-java'sTypeUtil.unwrapAll, which drops those casts and a!is TypeNamecheck that could never be true.Same thing in
UnmappedInputFieldChecker#inputObjectOf:GraphQLTypeUtil.unwrapAllAscan return aGraphQLNamedTypedirectly since every unwrapped schema type has a name, type references included.TypeUtilisn't annotated@PublicApi, but it's been in graphql-java since at least 20.0.The only behaviour change is the type matcher's error message, which now prints the SDL type with
TypeUtil.simplePrint. For a[Book!]!field whose resolver returns a singleBook:becomes
GraphQLTypeUtilitself didn't help much elsewhere since most of our code works on SDL types, not schema types.mvn clean verifypasses against graphql-java 26.1 and 25.1. I also ran every verify-tools scenario on this branch and on master: same schemas, results and logs, except the error message above.